<?php
//The next comment block is for PHPDocumentor
/**
 * Conference Registration - Registration for conferences
 * 
 * Admin menu option:
 * Setup a new conference
 * 
 * @author Kevin van Haaren (kevin@vanhaaren.net)
 * @copyright 2006 Kevin van Haaren, US
 * @package CONFREG
 * @subpackage Admin_Function
 * 
 */

/**
* Do all the declarations etc needed by an admin page
*/
include_once "adminheader.inc";

//Display the admin menu
xoops_module_admin_menu(6,_AM_CONFREG_ADMENU5);

$cleanPost = cleanInput($_POST);
$submit = $cleanPost['submit'];
if (isset($cleanPost['conf_id'])) {
	$conf_id = intval($cleanPost['conf_id']);
}

$conferences =& $xoopsDB->query('SELECT *' .
							 	' FROM ' . $xoopsDB->prefix("confreg_conferences") .
							 	' WHERE conf_id = ' . $conf_id );

$confData = $xoopsDB->fetchArray($conferences);

//$conf_count = $xoopsDB->getRowsNum($conferences);
echo "<table width=90%>";
echo '<tr><th style="text-align:center;">Conf<br />ID</th><th width=33% style="text-align:center;">Title</th><th style="text-align:center;">Start Date</th><th style="text-align:center;">End Date</th><th>&nbsp;</th></tr>';
echo "<tr>";
echo '<td style="text-align:center;">' . $confData['conf_id'] . "</td>";
echo "<td>" . $confData['title'] . "</td>";
echo '<td style="text-align:right;">' . substr($confData['start_date'],0,10) . "</td>";
echo '<td style="text-align:right;">' . substr($confData['end_date'],0,10) . "</td>";
echo '<td style="text-align:center;"><form action="send_pdh.php" method=post><input type=hidden name=conf_id value=' . $conf_id . '><input type=submit value="Send All PDH Certs"></form></td>';
echo "</tr>";
echo "</table></div><br /><br />";

include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';

// conference description
$cform = new XoopsThemeForm('Send Individual Certificate','sendpdh','send_pdh.php', 'POST');
$cform->addElement(new XoopsFormHidden('conf_id', $conf_id));
$cform->addElement(new XoopsFormText('Name on certificate', 'name', 60, 128));
$cform->addElement(new XoopsFormText('Date on certificate', 'date', 60, 128));
$radio = new XoopsFormRadio('6 or 12 hour certificate?', 'cert_type', '6');
$radio->addOption('6 Hour', '6');
$radio->addOption('12 Hour', '12');

$cform->addElement($radio);
$cform->addElement(new XoopsFormText('e-mail address', 'email', 60, 128));
$cform->addElement(new XoopsFormButton('Send Certificate', 'submit', 'submit', 'submit'));

$cform->display();

/**
* and here.
*/
//And put footer in
xoops_cp_footer();


// send pdf in an e-mail
// $result = email_file('kvanhaaren@hntb.com','kevin@kvmsg.com','TMCMCMC 2009 Professional Development Certificate','testing',$file,'application/pdf');
?>